<template>
    <a-modal
        class="icon-modal"
        :title="i18n('list.selectIconTitle','图标选择')"
        style="top: 20px;"
        :width="800"
        :height="580"
        :footer="null"
        v-model="visible"
        :zIndex="99999"
    >
        <icon-selector @change="handleIconChange"/>
    </a-modal>
</template>

<script>
import IconSelector from '@/components/IconSelector'
import {Util} from "@lowcode/jpaas-common-lib";

export default {
    name: 'IconSelectorView',
    components: {
        IconSelector
    },
    props:{
        layerid: {
            type: String,
            default: ""
        },
        destroy: {
            type: Function
        }
    },
    data() {
        return {
            visible: false,
            params: {}
        }
    },
    methods: {
        i18n(name,text,key){
            return this.$ti18(name,text,"SysApp",key);
        },
        show(params) {
            this.visible = true;
            this.params = params;
        },
        handleIconChange(icon) {
            this.visible = false;
            this.$emit('ok', icon, this.params)
            if(this.layerid){
                Util.closeWindow(this, "ok",this.params);
            }
        }
    }
}
</script>
<style scoped>
.icon-modal >>> .ant-modal-body{
    padding: 0;
}
</style>
